/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author victor.silva
 */
@Entity
@Table(name = "disciplina")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Disciplina.findAll", query = "SELECT d FROM Disciplina d"),
    @NamedQuery(name = "Disciplina.findByDscCodigo", query = "SELECT d FROM Disciplina d WHERE d.dscCodigo = :dscCodigo"),
    @NamedQuery(name = "Disciplina.findByDscDescricao", query = "SELECT d FROM Disciplina d WHERE d.dscDescricao = :dscDescricao"),
    @NamedQuery(name = "Disciplina.findByDscTtlhrsteoricas", query = "SELECT d FROM Disciplina d WHERE d.dscTtlhrsteoricas = :dscTtlhrsteoricas"),
    @NamedQuery(name = "Disciplina.findByDscTtlhrspraticas", query = "SELECT d FROM Disciplina d WHERE d.dscTtlhrspraticas = :dscTtlhrspraticas"),
    @NamedQuery(name = "Disciplina.findByDscTtlhrsestagio", query = "SELECT d FROM Disciplina d WHERE d.dscTtlhrsestagio = :dscTtlhrsestagio"),
    @NamedQuery(name = "Disciplina.findByDscTtlhrsaps", query = "SELECT d FROM Disciplina d WHERE d.dscTtlhrsaps = :dscTtlhrsaps"),
    @NamedQuery(name = "Disciplina.findByDscTtlhrspcc", query = "SELECT d FROM Disciplina d WHERE d.dscTtlhrspcc = :dscTtlhrspcc"),
    @NamedQuery(name = "Disciplina.findByTblgrlitmTpdisciplina", query = "SELECT d FROM Disciplina d WHERE d.tblgrlitmTpdisciplina = :tblgrlitmTpdisciplina")})
public class Disciplina implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2147483647)
    @Column(name = "dsc_codigo")
    private String dscCodigo;
    @Size(max = 2147483647)
    @Column(name = "dsc_descricao")
    private String dscDescricao;
    @Column(name = "dsc_ttlhrsteoricas")
    private Integer dscTtlhrsteoricas;
    @Column(name = "dsc_ttlhrspraticas")
    private Integer dscTtlhrspraticas;
    @Column(name = "dsc_ttlhrsestagio")
    private Integer dscTtlhrsestagio;
    @Column(name = "dsc_ttlhrsaps")
    private Integer dscTtlhrsaps;
    @Column(name = "dsc_ttlhrspcc")
    private Integer dscTtlhrspcc;
    @Size(max = 2147483647)
    @Column(name = "tblgrlitm_tpdisciplina")
    private String tblgrlitmTpdisciplina;
    @JoinColumn(name = "str_codigo", referencedColumnName = "str_codigo")
    @ManyToOne
    private Setor strCodigo;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "disciplina")
    private List<Turma> turmaList;

    public Disciplina() {
    }

    public Disciplina(String dscCodigo) {
        this.dscCodigo = dscCodigo;
    }

    public String getDscCodigo() {
        return dscCodigo;
    }

    public void setDscCodigo(String dscCodigo) {
        this.dscCodigo = dscCodigo;
    }

    public String getDscDescricao() {
        return dscDescricao;
    }

    public void setDscDescricao(String dscDescricao) {
        this.dscDescricao = dscDescricao;
    }

    public Integer getDscTtlhrsteoricas() {
        return dscTtlhrsteoricas;
    }

    public void setDscTtlhrsteoricas(Integer dscTtlhrsteoricas) {
        this.dscTtlhrsteoricas = dscTtlhrsteoricas;
    }

    public Integer getDscTtlhrspraticas() {
        return dscTtlhrspraticas;
    }

    public void setDscTtlhrspraticas(Integer dscTtlhrspraticas) {
        this.dscTtlhrspraticas = dscTtlhrspraticas;
    }

    public Integer getDscTtlhrsestagio() {
        return dscTtlhrsestagio;
    }

    public void setDscTtlhrsestagio(Integer dscTtlhrsestagio) {
        this.dscTtlhrsestagio = dscTtlhrsestagio;
    }

    public Integer getDscTtlhrsaps() {
        return dscTtlhrsaps;
    }

    public void setDscTtlhrsaps(Integer dscTtlhrsaps) {
        this.dscTtlhrsaps = dscTtlhrsaps;
    }

    public Integer getDscTtlhrspcc() {
        return dscTtlhrspcc;
    }

    public void setDscTtlhrspcc(Integer dscTtlhrspcc) {
        this.dscTtlhrspcc = dscTtlhrspcc;
    }

    public String getTblgrlitmTpdisciplina() {
        return tblgrlitmTpdisciplina;
    }

    public void setTblgrlitmTpdisciplina(String tblgrlitmTpdisciplina) {
        this.tblgrlitmTpdisciplina = tblgrlitmTpdisciplina;
    }

    public Setor getStrCodigo() {
        return strCodigo;
    }

    public void setStrCodigo(Setor strCodigo) {
        this.strCodigo = strCodigo;
    }

    @XmlTransient
    public List<Turma> getTurmaList() {
        return turmaList;
    }

    public void setTurmaList(List<Turma> turmaList) {
        this.turmaList = turmaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (dscCodigo != null ? dscCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Disciplina)) {
            return false;
        }
        Disciplina other = (Disciplina) object;
        if ((this.dscCodigo == null && other.dscCodigo != null) || (this.dscCodigo != null && !this.dscCodigo.equals(other.dscCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "modelo.Disciplina[ dscCodigo=" + dscCodigo + " ]";
    }
    
}
